import { generic } from './generic.js';
generic();
const bgc = document.querySelector('.filterheader');
const allpicture = document.querySelector('.allpicture');
console.log(allpicture);
window.addEventListener('load', async () => {
  const { data } = await axios({
    // 请求地址
    url: 'http://website.bluej.cn/api/carouselGroup/get',
    // 请求方式
    method: 'GET',
    params: {
      carouselGroupId: '1340',
    },
  });
  const pictureAll = data.data.Carousels;
  console.log(pictureAll);
  bgc.style.backgroundImage = `url(${pictureAll[0].url})`;
  pictureAll.slice(1).forEach((ele) => {
    const li = document.createElement('li');
    li.innerHTML += `
    <a href="">
    <div class="picture">
    <img src="${ele.url}" alt=""/>
    </div>
    <p>臻白晶透系列</p>
    <h1>臻曜晶透轻酸焕亮精华水</h1>
    <h2>查看产品</h2>
  </a>
    `;
    allpicture.appendChild(li);
  });
});
